<!DOCTYPE html>
<html>
   <head>
      <meta charset="utf-8" />
      <title>jQuery .hover() Example - jQuery in Action, 3rd edition</title>
      <link rel="stylesheet" href="../css/main.css"/>
      <style>
         .outer
         {
            position: relative;
            width: 200px;
            height: 100px;
            border: 1px solid #000000;
            background-color: #55AA55;
         }

         .inner
         {
            width: 50%;
            height: 50%;
            margin: 0.5em auto;
            border: 1px solid #000000;
            background-color: #FFFF4F;
         }

         #outer2
         {
            margin-top: 2em;
         }
      </style>
   </head>

   <body>
      <div class="outer" id="outer1">
         Outer 1
         <div class="inner" id="inner1">Inner 1</div>
      </div>
      <div class="outer" id="outer2">
         Outer 2
         <div class="inner" id="inner2">Inner 2</div>
      </div>

      <p>The output is printed on the console</p>

      <script src="../js/jquery-1.11.3.min.js"></script>
      <script>
         function report(event) {
            event.stopPropagation();
            console.log(event.type + ' on ' + event.target.id);
         }

         $('#outer1').on('mouseover mouseout', report);
         $('#inner1').on('mouseover mouseout', report);
         $('#outer2').hover(report);
         $('#inner2').hover(report);
      </script>
   </body>
</html>
